package com.bing.my.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;

/**
 * <p>
 *
 * </p>
 *
 * @author bing
 * @since 2021-09-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 账号id
     */
      @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 账户名
     */
    @NotBlank(message="账户名不能为空")
    private String username;

    /**
     * 账户密码
     */
    private String password;
    /**
     * 头像地址
     */
    private String avatar;

    /**
     * 角色
     */
    private String roles;
    /**
     * 权限
     */
    private String permission;

    /**
     * 创建时间
     */
      @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
      @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    /**
     * 乐观锁，默认值1
     */
    @Version
    private Integer version;

    /**
     * 逻辑删除，默认0，1为删除
     */
    @TableLogic
    private Integer deleted;


}
